<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/vue.js"></script>
</head>
<body>
  <div id="root">
    <h2>欢迎来到{{name}}</h2>
    <!-- v-on:click  当点击的时候找到showInfo函数 -->
    <button v-on:click="showInfo1">点我提示信息1 (不传参)</button>    
      <!-- 简写 -->
    <button @click="showInfo1">点我提示信息</button>    

    <button @click="showInfo2($event,66)">点我提示信息2  (传参)</button>    
  
  </div>
  <script type="text/javascript">
     const vm=new Vue({
        el:'#root',
        data:{
          name:'南工'
        },
        methods:{
          showInfo1(event){
            alert('你好同学1') 
          },
          showInfo2(event,number){
            alert('你好同学2')
          console.log(event,number);
          }
        }
      })
    </script>
</body>
</html>